<?php
 class ogc{
    
    protected $params;
    protected $operationname;
        
    ### sample function getObservation should of course not be in the base class...
    function getObservation($params=null){
        return 'getObservation';
    }
    ###
    ##test 
    function getCapabilities($params=null){
        return 'getCapabilities';
    }    
    
    #This function chooses the correct function for a given operation name -> variable functions
    function setOperationMethod($operationname){
        if(method_exists($this,$operationname))
            return $this->$operationname($this->operationparams);
        else return 'Operation does not exist';
    }
    
    #This function should read the Allowed_Operations XML and set the metadata (parameters) for the given operation
    function setOperationMetadata($operation){
        #read the XML and choose the correct params
        $this->operationparams=$params;
    }
    
    #Parses the incoming request
    function getRequest(){
        #parse the XML and find operationname
        $this->operationname=$foundopname;
        $this->operationparams=$this->setOperationMetadata($this->operationname);
    }
    
    function setResponse(){
        $this->setOperationMethod($this->operationname);
    }    
        
    function __construct (){
        
    }
 }
 
 $o=new ogc();
 echo $o->setOperationMethod('getCapabilities');
 echo $o->setOperationMethod('getObservation');
 echo $o->setOperationMethod('getNonsense');
?>
